package com.bw.test;

import com.bw.gmall.realtime.utils.MyKafkaUtil;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;

public class DemoTest3 {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        FlinkKafkaConsumer<String> flinkKafkaConsumerAll =
                MyKafkaUtil.getFlinkKafkaConsumerAll("dwd_traffic_page_log",
                        "dwd_traffic_page_log_1");
        DataStreamSource<String> ds = env.addSource(flinkKafkaConsumerAll);
        ds.print();
        env.execute();

    }
}
